Create Simple Login Page with PHP and MySQL 您所在的位置:网站首页 how to create a contact page with php Create Simple Login Page with PHP and MySQL

Create Simple Login Page with PHP and MySQL

2023-04-08 22:34| 来源: 网络整理| 查看: 265

Login page allows the registered user to access the website and manage its account by entering its username and password.

User SESSION is been created on a successful login attempt.

This helps to detect the user is actually logged in or not when going to other web pages and it also helps to display content according to the user.

In this tutorial, I show how you can create a Login page with PHP and MySQL.

Create Simple Login Page with PHP and MySQL

Demo 聽DownloadContentsTable structureConfigurationHTMLCSSPHPDemoConclusion1. Table structure

I am using users table in the tutorial example.

CREATE TABLE `users` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `username` varchar(80) NOT NULL, `name` varchar(80) NOT NULL, `password` varchar(80) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;2. Configuration

Create config.php file for database configuration.

Completed Code

Homepage 6.聽Demo

View Demo

7.聽Conclusion

In this tutorial, I showed how you can create a simple login page with PHP and MySQL.

You must have to initialize the $_SESSION variable to detect the user when traversing to other pages and destroy it when the user clicks the logout buttons.

If you want to know how to create a register page then you can view the following tutorial.

If you found this tutorial helpful then don't forget to share.


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有